#include <bits/stdc++.h>
using namespace std;

const int N = 1e5+5;
typedef long long LL;
int t, n, a[N], s;
LL sum[N];

LL realsum(int i, int s)
{
    return sum[s] - (i<=s? a[i]:0);
}


int main(int argc, char const *argv[])
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> t;
    for (int kk=0; kk<t; ++kk)
    {
        cin >> n >> s;
        for (int i=0; i<n; ++i)
            cin >> a[i];
        sum[0] = a[0];
        for (int i=1; i<n; ++i) sum[i] = sum[i-1] + a[i];

        if (sum[n-1] <= s)
        {
            printf("%d\n", 0);
            continue;
        }
        int ans = 0, ansx = 0;
        for (int i=0; i<n; ++i)
        {
            int l = -1, r = n;
            while (l < r-1)
            {
                int m = (l+r) >> 1;
                if (m == -1) l = m;
                else if (realsum(i, m) <= s) l = m;
                else r = m;
            }
            if (l+1 > ans)
            {
                ans = l + 1;
                ansx = i+1;
            }
        }
        printf("%d\n", ansx);
    }
    return 0;
}
